import {fileURLToPath}from 'url'
import nunjucks from 'nunjucks'
let fn_list=async (ctx)=>{
    ctx.body='博客列表'
    // ctx.render('blogs.html',{blogs:[{},{},{},{}]})
    let path=new URL('../views',import.meta.url)
    let newpath=fileURLToPath(path.href)
    console.log(newpath);
    
    let env=nunjucks.configure(newpath,{noCache:true,watch:true})
    ctx.body=env.render(html,{blogs:[
        {
            ID:1,
            Title:"快乐"
        }
    ]})
}
export const obj={
    'get /blogs':fn_list
}